.file-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  .file-info {
    display: flex;
    align-items: center;
    gap: 12px;

    .file-name {
      font-weight: 500;
      color: #262626;
      max-width: 400px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}

.file-viewer-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #f5f5f5;
  border-radius: 6px;
  overflow: hidden;

  .loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;

    p {
      margin-top: 16px;
      color: #666;
      font-size: 14px;
    }
  }

  // react-file-viewer 样式覆盖
  .pg-viewer-wrapper {
    height: 100% !important;
    
    .pg-viewer {
      height: 100% !important;
      
      iframe {
        width: 100% !important;
        height: 100% !important;
        border: none;
      }
    }
  }

  .docx-wrapper {
    height: 100% !important;
    overflow-y: auto;
    padding: 20px;
    background: white;

    .docx-viewer {
      max-width: 800px;
      margin: 0 auto;
      background: white;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      border-radius: 4px;
      padding: 40px;
      line-height: 1.6;
      font-family: 'Times New Roman', serif;
      
      h1, h2, h3, h4, h5, h6 {
        color: #262626;
        margin: 20px 0 10px 0;
      }
      
      p {
        margin: 10px 0;
        color: #262626;
      }
      
      table {
        width: 100%;
        border-collapse: collapse;
        margin: 20px 0;
        
        th, td {
          border: 1px solid #d9d9d9;
          padding: 8px 12px;
          text-align: left;
        }
        
        th {
          background: #fafafa;
          font-weight: 600;
        }
      }
    }
  }

  .xlsx-wrapper {
    height: 100% !important;
    overflow: auto;
    background: white;

    .xlsx-viewer {
      padding: 20px;
      
      table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
        
        th, td {
          border: 1px solid #d9d9d9;
          padding: 6px 8px;
          text-align: left;
          min-width: 80px;
        }
        
        th {
          background: #f0f0f0;
          font-weight: 600;
          position: sticky;
          top: 0;
          z-index: 1;
        }
        
        tr:nth-child(even) {
          background: #fafafa;
        }
      }
    }
  }

  .pptx-wrapper {
    height: 100% !important;
    overflow-y: auto;
    background: #f0f0f0;
    padding: 20px;

    .pptx-viewer {
      .slide {
        background: white;
        margin: 20px auto;
        max-width: 800px;
        min-height: 600px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        padding: 40px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        
        h1, h2, h3 {
          text-align: center;
          color: #262626;
          margin-bottom: 20px;
        }
        
        p {
          color: #262626;
          line-height: 1.8;
          margin: 10px 0;
        }
        
        ul, ol {
          padding-left: 30px;
          
          li {
            margin: 8px 0;
            line-height: 1.6;
          }
        }
      }
    }
  }

  .txt-wrapper {
    height: 100% !important;
    overflow-y: auto;
    background: white;
    padding: 20px;

    .txt-viewer {
      max-width: 800px;
      margin: 0 auto;
      font-family: 'Courier New', monospace;
      font-size: 14px;
      line-height: 1.6;
      color: #262626;
      white-space: pre-wrap;
      word-wrap: break-word;
    }
  }

  .ant-alert {
    margin: 20px;
    border-radius: 6px;
  }
}

// 响应式设计
@media (max-width: 768px) {
  .file-viewer-header {
    .file-info {
      .file-name {
        max-width: 200px;
        font-size: 14px;
      }
    }
  }

  .file-viewer-container {
    .docx-wrapper .docx-viewer {
      padding: 20px;
      font-size: 14px;
    }

    .xlsx-wrapper .xlsx-viewer {
      padding: 10px;
      
      table {
        font-size: 11px;
        
        th, td {
          padding: 4px 6px;
          min-width: 60px;
        }
      }
    }

    .pptx-wrapper .pptx-viewer .slide {
      padding: 20px;
      min-height: 400px;
      
      h1, h2, h3 {
        font-size: 18px;
      }
      
      p {
        font-size: 14px;
      }
    }

    .txt-wrapper .txt-viewer {
      padding: 10px;
      font-size: 12px;
    }
  }
}

// 打印样式
@media print {
  .file-viewer-container {
    .docx-wrapper .docx-viewer {
      box-shadow: none;
      padding: 0;
    }
  }
}